class Int

    public int parse(String i)

        if( i == "0" || i == "cero")
            return 0
        elsif( i == "1" || i == "uno")
            return 1
        elsif( i == "2" || i == "dos")
            return 2
        elsif( i == "3" || i == "tres")
            return 3
        elsif( i == "4" || i == "cuatro")
            return 4
        elsif( i == "5" || i == "cinco")
            return 5
        elsif( i == "6" || i == "seis")
            return 6
        elsif( i == "7" || i == "siete")
            return 7
        elsif( i == "8" || i == "ocho")
            return 8
        elsif( i == "9" || i == "nueve")
            return 9
        else            
            return -1        

    public String toWords(int i)

        if( i == 0 )
            return "cero"

        if( i < 0 )
            return "negativo"


        String result = ""

        while (i > 0)

            int d = i % 10
            i /= 10
            
            
            if ( d <= 0 )
                result += "cero."
            elsif ( d <= 1 )
                result = result + "uno."
            elsif ( d <= 2 )
                result = result + "dos."
            elsif ( d < 4 )
                result = result + "tres."
            elsif ( d <= 4)
                result += "cuatro."
            elsif ( d <= 5)
                result += "cinco."
            elsif ( d <= 6)
                result += "seis."
            elsif ( d <= 7)
                result += "siete."
            elsif ( d <= 8)
                result += "ocho."
            elsif ( d <= 9)
                result += "nueve."
        return result
        
    public void readyGo()

        Int conv = new Int()

        shout(conv.parse("0"))
        shout(conv.toWords(0))

        shout(conv.parse("hasbeenah"))

        shout(conv.toWords(1023456789))
